# coding=utf-8
#! /usr/bin/python

"""
__author__='wudi'
@File:auto_send_wechat.py
@Time:2017/5/26 16:23
"""
#解决编码不一致问题
import sys
import itchat
from datetime import date, time, datetime, timedelta
import time

reload(sys)
sys.setdefaultencoding("utf-8")


from autorun import runTask
from wechat_instance import get_userid,sendmsg

#初始化
sleeptime_day = 0
sleeptime_min = 0
sleeptime_hour = 0
sleeptime_second = 3600 #86400秒，间隔24小时

if __name__=="__main__":
    #命令行显示二维码（linux下适用）itchat.auto_login(enableCmdQR=True)
    #调整显示的二维码大小 itchat.auto_login(enableCmdQR=2)
    itchat.auto_login(hotReload=True)
    userid = get_userid('Edricdi')
    runTask(sendmsg,userid,day=sleeptime_day, hour=sleeptime_hour, min=sleeptime_min, second=sleeptime_second)